<!--#Include File="../../../Include.asp"--><%
'--------------------------------------
'Power By 方卡在线 @2010-2014 f02
'URL:http://www.fangka.net/
'EMail:admin@ifangka.com
'QQ:861118936
'版权所有 未经允许不得去除本版权信息
'--------------------------------------

Dim f_Width,f_Height,f_Count
Dim f_Pic,f_Text,f_Url
Dim FocusPic,FocusText,FocusUrl

FocusPic=""
FocusText=""
FocusUrl=""

Types=Clng(Request.QueryString("Type"))
f_Width=Request.QueryString("Width")
f_Height=Request.QueryString("Height")
f_Count=5

If f_Width="" Then
	f_Width=100
Else
	f_Width=Clng(f_Width)
End If
If f_Height="" Then
	f_Height=100
Else
	f_Height=Clng(f_Height)
End If


If Types=0 Then '读取菜单项带图片数据
	MenuId=Clng(Request.QueryString("Menu"))
	ModuleId=Clng(Request.QueryString("Module"))
	Set FKTemplate=New Cls_Template
	Sqlstr="Select Top "&f_Count&" Fk_View_Id,Fk_View_Title,Fk_View_Pic,Fk_View_Url,Fk_View_Link,Fk_Module_Url From [Fk_ViewList] Where Fk_View_Show=1 And Fk_Module_State=1 And (Fk_View_Pic Like '%%.gif' Or Fk_View_Pic Like '%%.jpg')"
	If MenuId>0 Then
		Sqlstr=Sqlstr&" And Fk_View_Menu="&MenuId&""
	End If
	If ModuleId>0 Then
		Sqlstr=Sqlstr&" And Fk_View_Module="&ModuleId&""
	End If
	Sqlstr=Sqlstr&" Order By Fk_View_Id Desc"
	Rs.Open Sqlstr,Conn,1,1
	While Not Rs.Eof
		'数据获取
		f_Pic=Rs("Fk_View_Pic")
		f_Text=Rs("Fk_View_Title")
		If Rs("Fk_View_Link")<>"" Then
			f_Url=Rs("Fk_View_Link")
		Else
			f_Url=FKTemplate.GetUrl(FullSiteDir,"",Rs("Fk_Module_Url"),Rs("Fk_View_Url"),FullHtmlSuffix,2,Rs("Fk_View_Id"),"")
		End If
		
		'数据输出
		If FocusPic="" Then
			FocusPic=f_Pic
		Else
			FocusPic=FocusPic&"|"&f_Pic
		End If
		If FocusText="" Then
			FocusText=f_Text
		Else
			FocusText=FocusText&"|"&f_Text
		End If
		If FocusUrl="" Then
			FocusUrl=f_Url
		Else
			FocusUrl=FocusUrl&"|"&f_Url
		End If
		
		Rs.MoveNext
	Wend
	Rs.Close
ElseIf Types=1 Then '读取独立轮换代码
	Id=Clng(Request.QueryString("Id"))
	Sqlstr="Select Fk_Focus_Name,Fk_Focus_Content From [Fk_Focus] Where Fk_Focus_Id=" & Id
	Rs.Open Sqlstr,Conn,1,1
	If Not Rs.Eof Then
		TempArr=Split(Rs("Fk_Focus_Content"),"|FocusList|")
	Else
		Rs.Close
		Call FKFun.PageEnd()
	End If
	Rs.Close
	For Each Temp In TempArr
		If Temp<>"" Then
			f_Text=FKFun.GetSub(Temp,"Focus_Title:","|;|","")
			f_Url=FKFun.GetSub(Temp,"Focus_Url:","|;|","")
			f_Pic=FKFun.GetSub(Temp,"Focus_Pic:","|;|","")
		
			'数据输出
			If FocusPic="" Then
				FocusPic=f_Pic
			Else
				FocusPic=FocusPic&"|"&f_Pic
			End If
			If FocusText="" Then
				FocusText=f_Text
			Else
				FocusText=FocusText&"|"&f_Text
			End If
			If FocusUrl="" Then
				FocusUrl=f_Url
			Else
				FocusUrl=FocusUrl&"|"&f_Url
			End If
		End If
	Next
End If
'转码
FocusPic=Server.URLEncode(FocusPic)
FocusText=Server.URLEncode(FocusText)
FocusUrl=Server.URLEncode(FocusUrl)

%>
var focus_width=<%=f_Width%>;
var focus_height=<%=f_Height%>;
var text_height=0;
var swf_height = focus_height+text_height;
var pics='<%=FocusPic%>';
var links='<%=FocusUrl%>';
var texts='<%=FocusText%>';
document.write('<object ID="focus_flash" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="'+ focus_width +'" height="'+ swf_height +'">');
document.write('<param name="allowScriptAccess" value="sameDomain"><param name="movie" value="<%=SiteDir%>Plugin/FlashFocus/Default/focus.swf"><param name="quality" value="high"><param name="bgcolor" value="#ffffff">');
document.write('<param name="menu" value="false"><param name=wmode value="opaque">');
document.write('<param name="FlashVars" value="pics='+pics+'&links='+links+'&texts='+texts+'&borderwidth='+focus_width+'&borderheight='+focus_height+'&textheight='+text_height+'">');
document.write('<embed ID="focus_flash" src="<%=SiteDir%>Plugin/FlashFocus/Default/focus.swf" wmode="opaque" FlashVars="pics='+pics+'&links='+links+'&texts='+texts+'&borderwidth='+focus_width+'&borderheight='+focus_height+'&textheight='+text_height+'" menu="false" class=tablebody1 quality="high" width="'+ focus_width +'" height="'+ focus_height +'" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"/>');
document.write('</object>');
<%
Call FKFun.PageEnd()
%>
